## -------------------------------------------------- #
##  Wirtschafter, Batista Pereira, Bueno, Pavão, Oliveira dos Santos, and Nunes_README
## -------------------------------------------------- #


Date: 01-08-2023

Authors: Wirtschafter, Batista Pereira, Bueno, Pavão, Oliveira dos Santos, and Nunes

Title: Detecting Misinformation: Identifying False News Spread by Political Leaders in the Global South

Contact Information: Valerie Wirtschafter <valerie.wirtschafter@gmail.com>


Copyright (c) 2023, under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
 For more information see: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
 All rights reserved. 


## -------------------------------------------------- #

This file describes the contents of the replication archive used to conduct the analyses in the main text and appendix. 


## -------------------------------------------------- #


R Information:

The files in the Replication Files folder make use of the R project in the folder.

Click on the .Rproj file to open the R project in RStudio and then you can run any of the .R files.

Install packages if necessary:
packages <- c("tidyverse", "estimatr", "xtable", "readxl",          "MASS", "sampleSelection", "rockchalk", "modelsummary",           "texreg", "broom", "stm", "stringr", "topicmodels", "tm","reshape2", 
	  "pals", "stopwords", "text2vec", "stopwords", "qdapRegex", 
	  "stringi", "hrbrthemes", "patchwork")


install.packages(packages)


## -------------------------------------------------- #
#  folder/file structure
## -------------------------------------------------- #

├── ReadMe.txt           			       
├── Data
	├── final-politician-dat.rds                                                               
├── Codebook.xlsx                                                                             
├── pol-analysis.R
├── _creating-data.R                                    
├── _post-analysis.R 
├── SessionInfo.png 

The code files are in the root folder. See a description below. 

## -------------------------------------------------- #

Conducting the verification: 

Save the replication files locally, preserving the folder structure in the replication materials. The replication code assumes a certain folder (directory) structure. As long as the folders are in the R working directory the script will find these files and work properly. 

Please create/use the folder data within the directory to save the data files so the replication can be conducted. 


1. Create a Figures folder 
2. Create a Tables folder 


## -------------------------------------------------- #

Files description:

The data folder contains the following files:
final-politician-dat.rds -- politician level data, created using the _creating-pol-data.R script


Code:
pol-analysis.R -- script for the politician-level analyses in the main and appendix. This script uses the final-politician-dat.rds
_post-analysis.R -- script for the post-level analyses in the main and appendix. The data used in this script cannot be shared (see Notes below). 
_creating-data.R -- script for creating the post and politician-level analysis data. The original data used in this script cannot be shared (see Notes below), but the output is included as final-politician-dat.rds. The data used in this script cannot be shared (see Notes below). 

 SessionInfo -- information about packages and R version


## -------------------------------------------------- #

Notes:

Our original data was collected via:

1. CrowdTangle for the Facebook and Instagram Data: Due to CrowdTangle's terms of use, we cannot make post level data available. The public lists IDs we built are: Facebook (1443604) and Instagram (1810629). Note that politicians' accounts could have changed since our original data collection. 
2. Twitter API for the Twitter Data (no longer freely available to researchers)
3. Web scraping for the fact-checking data: we do not make the code for the fact-checking data scraping available because the incorrect use of the code could lead to violation of norms of use and terms of use of these websites. Please contact us if interested in more details, and for requests to access the original data.
4. Facebook Fact-checked links: access via Social Science One partnership: https://socialscience.one/facebook-dataverse
5. Ideology data: from Zucco and Power (2021) https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/ARYBJI
6. Politicians’ social media ids: directly collected by the authors (only verified or double
checked ids were used)
7. Electoral information: from TSE and CEPESP: https://cepespdata.io/ and https://dadosabertos.tse.jus.br/
8. GDI data: due to our agreement with GDI, we cannot make their domain level data available. Please contact GDI directly if interested in the data: https://www.disinformationindex.org/ Here is the report with the aggregate data is described: https://itsrio.org/wp-content/uploads/2021/09/2021-09-15-Brazil-Disinformation-Risk-Assessment-Report-Online.pdf




